builder/azure-arm: Remove duplicate resource deletion steps#9559
Merged
SwampDragons merged 7 commits intomasterfrom Aug 12, 2020
Merged
builder/azure-arm: Remove duplicate resource deletion steps#9559SwampDragons merged 7 commits intomasterfrom
SwampDragons merged 7 commits intomasterfrom
Conversation
Codecov Report
|
115c2ba to
473b104
Compare
* Add an ResourceNotFound error check * Add logic to break temporary disk lease before deleting it
SwampDragons
approved these changes
Aug 12, 2020
Contributor
SwampDragons
left a comment
There was a problem hiding this comment.
Wow, awesome job sorting through all of this and cleaning it up. I ran tests against my windows and linux configs and it all seemed to work as expected.
🎉
| return | ||
| } else { | ||
| ui.Say("\nCleanup requested, deleting resource group ...") | ||
| } |
| func (s *StepDeleteAdditionalDisk) deleteBlob(storageContainerName string, blobName string) error { | ||
| blob := s.client.BlobStorageClient.GetContainerReference(storageContainerName).GetBlobReference(blobName) | ||
| err := blob.Delete(nil) | ||
| _, err := blob.BreakLease(nil) |
| "Error: %s", imageName, err)) | ||
| } | ||
| } | ||
| return blob.Delete(nil) |
Contributor
There was a problem hiding this comment.
Well this is simplified!
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change removes StepDeleteResourceGroup from the ARM builder. The StepDeleteResourceGroup step was a combination of StepCreateResourceGroup#Cleanup and StepDeployTemplate#Cleanup. Which was causing soft errors on cleanup because the Azure builder was trying to access resources in the step cleanup functions that were deleted by StepDeleteResourceGroup.
This change also removes the StepDeleteOSDisk and modifies the StepDeleteAdditionalDisk steps as they were found to be only working when the StepDeleteResourceGroup was being executed. More specifically, the DeleteResourceGroup step was deleting all deployment operations including the resource group associated with the build so the additional delete steps were essentially a noop. After removing the call to the DeleteResourceGroup step the following error was being thrown
#Closes #9482
Build Results Before Change
VHD basic build
Build results after change
Regression suite run, after change
Custom Key Vault Test
Additional Disk Test
Manged Disk Build
Todos